//
//  HZAreaPickerView.h
//  areapicker
//
//  Created by Cloud Dai on 12-9-9.
//  Copyright (c) 2012年 clouddai.com. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HZLocation.h"

typedef enum {
    HZAreaPickerWithStateAndCityAndDistrict=0,
    HZAreaPickerWithStateAndCity,
    HZAreaPickerWithState
} HZAreaPickerStyle;
typedef enum
{
    HZAreaPickerInitNormalOption=0,
    HZAreaPickerInitStandardOption,
    HZAreaPickerInitAddtionnalOption
    
}HZAreaPickerInitOption;

@class HZAreaPickerView;

@protocol HZAreaPickerDelegate <NSObject>

@optional
- (void)pickerDidChangeStatus:(HZAreaPickerView *)picker;
- (void)pickerDidDismiss:(HZAreaPickerView *)picker;
@end

@interface HZAreaPickerView : UIView <UIPickerViewDelegate, UIPickerViewDataSource>
{
    NSMutableArray *_tmpCities;
    NSMutableArray *_tmpRegions;
    NSMutableDictionary *locations;
    NSMutableDictionary *_state;
    NSMutableDictionary *_city;
    NSMutableDictionary *_region;
}
@property (assign, nonatomic) id <HZAreaPickerDelegate> delegate;
@property (retain, nonatomic) IBOutlet UIPickerView *locatePicker;
@property (retain, nonatomic) HZLocation *locate;
@property (nonatomic) HZAreaPickerStyle pickerStyle;
@property (retain, nonatomic) NSMutableArray *sstates;
@property (retain, nonatomic) NSArray *cities;
@property (retain, nonatomic) NSArray *areas;
@property (retain, nonatomic) NSString *location;

- (id)initWithStyle:(HZAreaPickerStyle)pickerStyle delegate:(id<HZAreaPickerDelegate>)delegate withOption:(NSInteger)option;
- (void)showInView:(UIView *)view;
- (void)cancelPicker;
- (void)selectPickerView:(NSString *)location;


@end
